1include <../std.scad>
 2
 3
 4module test_tri_functions() {
 5    sides = rands(1,100,100,seed_value=8181);
 6    for (p = pair(sides,true)) {
 7        adj = p.x;
 8        opp = p.y;
 9        hyp = norm([opp,adj]);
10        ang = atan2(opp,adj);
11
12        assert_approx(hyp_ang_to_adj(hyp,ang), adj);
13        assert_approx(opp_ang_to_adj(opp,ang), adj);
14        assert_approx(hyp_adj_to_opp(hyp,adj), opp);
15        assert_approx(hyp_ang_to_opp(hyp,ang), opp);
16        assert_approx(adj_ang_to_opp(adj,ang), opp);
17        assert_approx(adj_opp_to_hyp(adj,opp), hyp);
18        assert_approx(adj_ang_to_hyp(adj,ang), hyp);
19        assert_approx(opp_ang_to_hyp(opp,ang), hyp);
20        assert_approx(hyp_adj_to_ang(hyp,adj), ang);
21        assert_approx(hyp_opp_to_ang(hyp,opp), ang);
22        assert_approx(adj_opp_to_ang(adj,opp), ang);
23    }
24}
25*test_tri_functions();
26
27
28module test_hyp_opp_to_adj() nil();  // Covered in test_tri_functions()
29module test_hyp_ang_to_adj() nil();  // Covered in test_tri_functions()
30module test_opp_ang_to_adj() nil();  // Covered in test_tri_functions()
31module test_hyp_adj_to_opp() nil();  // Covered in test_tri_functions()
32module test_hyp_ang_to_opp() nil();  // Covered in test_tri_functions()
33module test_adj_ang_to_opp() nil();  // Covered in test_tri_functions()
34module test_adj_opp_to_hyp() nil();  // Covered in test_tri_functions()
35module test_adj_ang_to_hyp() nil();  // Covered in test_tri_functions()
36module test_opp_ang_to_hyp() nil();  // Covered in test_tri_functions()
37module test_hyp_adj_to_ang() nil();  // Covered in test_tri_functions()
38module test_hyp_opp_to_ang() nil();  // Covered in test_tri_functions()
39module test_adj_opp_to_ang() nil();  // Covered in test_tri_functions()
40
41
42// vim: expandtab tabstop=4 shiftwidth=4 softtabstop=4 nowrap